package Thread;
//可重入
public class ThreadDemo11 {
    public static void main(String[] args) {
        Object object1=new Object();
        Thread thread1=new Thread(()->{
            synchronized (object1){
                synchronized (object1){
                    System.out.println("获取到了两个资源,是可重入的");
                }
            }
        });
        thread1.start();
        try {
            thread1.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
